home *** CD-ROM | disk | FTP | other *** search
/ WINMX Assorted Textfiles / Ebooks.tar / Text - Tech - OS - Linux - Secure Linux for Newbies v.1.1 (TXT).zip / Secure Linux for Newbies v.1.1 / Secure Linux for Newbies v1.1.txt
Text File  |  2000-01-06  |  16KB  |  456 lines

  1. SecureLinux for Newbies v.1.1
  2.  
  3. Another document on securing your Linux workstation/server,
  4. for the newer Linux user/Admininstrator.
  5.  
  6. *** NOTE to Solaris users... Get Titan 3.0 ;) ***
  7. http://www.fish.com/titan/index.html
  8.  
  9. *** NOTE to Windows users... fdisk d c:\ ***
  10.  
  11. -=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
  12.  
  13. i       Why
  14. ii      Tools
  15. iii     Better
  16. iv      AfterEffects
  17. v       Copyrights
  18.  
  19. -=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
  20.  
  21. i       Why?
  22.  
  23. Possibily because your new to Linux and are too dumb to find
  24. these things yourself, or your just trying to get a second
  25. opinion on securing your machine from some moron with too
  26. much time on his/her/it's hands. This document was mainly
  27. written because I had too much time on my hands and for the
  28. most part I hate reading "x == y if 666^308*0 == a || b"
  29. type documentation.
  30.  
  31. Besides I would like to know if aside from my work station
  32. being uberleetly secured, you managed to make this doc work
  33. for you. So feedback would be nice.
  34.  
  35. Anyways to resolve all this without using any of this info
  36. you can always download OpenBSD, which I also use nowadays.
  37. OpenBSD is the most secure OS in existance, and is
  38. definitely my top choice for running an I'net site.
  39.  
  40. -=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
  41.  
  42. ii      Tools
  43.  
  44. Everyone needs tools on their work station to secure it unless
  45. you just plan on leaving it off the net, where it's probably
  46. at its most secure state. But that would take the fun out of
  47. getting to know just how vulnerable your box is. While this is
  48. no damn Harvard type tutorial, it is efficient as hell, and
  49. not full of some 0-day supercalifragilisticexpialidoscious type
  50. words which can confuse some of the newer users unfamiliar
  51. with technicalities.
  52.  
  53. -------------------------------------------------------------
  54.  
  55. 1. Portsentry
  56.  
  57. Portsentry is a tool from Psionic which detects abnormal
  58. activity from the log files. It detects most types of scans
  59. and is configurable to send root@localhost or wherever else,
  60. a detailed description of happenings on the system. Portsentry
  61. is also configure to auto drop a luzer into the
  62. /etc/hosts.deny which IMHO is pretty cool but ineffective
  63. once a dynamic host returns with a new IP_ADDR.
  64.  
  65. Abacus Project
  66. http://www.psionic.com
  67.  
  68.  
  69. 2. IPCHAINS
  70.  
  71. Although I see on newer kernels such as 2.3.20 which I use
  72. at work daily IPCHAINS is being replaced with Network Packet
  73. Filtering, many users are still on the IPCHAINS scene.
  74. I hate typing all the neccessary switches to get
  75. them to work, the thought of constantly typing:
  76.  
  77. ipchains -A yadda yadda deny yadda yadda
  78.  
  79. is sickening since your probably going to be constantly
  80. modifying this file. My suggestion would be to go to
  81. www.freshmeat.net and obtain GFCC.
  82.  
  83. GFCC is a GUI to use IPCHAINS without all of the crappy
  84. ass syntaxes to get IPCHAINS to work.
  85.  
  86. Now I would specify a kick ass ruleset here, but It'd
  87. be a nightmare to explain them. Besides I don't have
  88. that much time to kill. (Alcohol in the vicinity ;) )
  89.  
  90. So for my ruleset you can visit www.antioffline.com/xp0.rules
  91.  
  92. Mainly everything which should be unaccessable via
  93. the net is blocked out. For those running NAMED, WWW, etc.,
  94. the answer is simple: Uncomment it.
  95.  
  96. IPCHAINS download site:
  97. ftp://ftp.starshadow.com/pub/rustcorp/ipchains/
  98.  
  99. GFCC's downloadble via:
  100. http://icarus.autostock.co.kr/gfcc-0.7.1.tar.gz
  101.  
  102. 3. NMAP by Fyodor
  103.  
  104. Now what system would be complete without the joy of typing
  105. nmap -sR -sS -O -v 127.0.0.1 ... NMAP is probably one of
  106. the best scanners for obtaining an in-depth look at your
  107. machine. While it is a good scanner, you shouldn't bother
  108. trying to scan yourself if you have the IPCHAINS ruleset
  109. I listed above, since NMAP will think your machine is a
  110. Cisco router or Lexmark printer, you should scan your box
  111. before starting any ipchains ruleset and tweak those rules
  112. in accordance to NMAP's output. This is done for obvious
  113. reasons... Maximum effectiveness.
  114.  
  115. Fyodor's NMAP site is located at:
  116. http://www.insecure.org/nmap
  117.  
  118.  
  119. 4. Deception Tool Kit
  120.  
  121. Security through Obscurity can be a double edged sword,
  122. but do you really give a shit when it comes down to
  123. protecting your property? If thats the case post your
  124. login and passwords around and stop reading this doc.
  125.  
  126. Deception Tool Kit is a pretty much straightforward
  127. tool which generates fake information related to your
  128. machine. For example if your running Linux which most
  129. likely you are if your reading this, then you can have
  130. DTK generate a fake snapshot of another OS and have
  131. the results reply to a would be geoshitty kiddie trying
  132. to gain su on your machine. I don't feel like typing
  133. a whole slew of pro's and con's about DTK, but I will
  134. say its a kick ass tool to have.
  135.  
  136. Soluble Resolution? Download the shit and try it out. ;)
  137.  
  138. This is a sample of my inetd.conf file in which I removed
  139. mainly everything since this is just my personal box. On
  140. my servers I have minimal stuff open which limits the
  141. amount of possible remote exploits against the server.
  142.  
  143. #####################################################
  144. #
  145. # Sample inetd.conf file used in conjuction with
  146. # DTK. As you can see nothing is open, but when I
  147. # need to start something I comment it in and
  148. # kill -HUP inetd after I entered whatever it is
  149. # I needed. Simplicity owns. I've also thrown in
  150. # wrenches in my inetd.conf should anyone be able
  151. # to actually bypass my IPCHAINS. So basically
  152. # they end up with trashy info... Its obsolete
  153. # but I need humor in my life ;)
  154. #
  155. #####################################################
  156.  
  157. serv0   stream  tcp     nowait  root    /dtk/coredump
  158. serv2   stream  tcp     nowait  root    /dtk/coredump
  159. serv3   stream  tcp     nowait  root    /dtk/coredump
  160. serv4   stream  tcp     nowait  root    /dtk/coredump
  161. serv5   stream  tcp     nowait  root    /dtk/coredump
  162. serv6   stream  tcp     nowait  root    /dtk/coredump
  163. echo    stream  tcp     nowait  root    /dtk/coredump
  164. echo    dgram   udp     wait    root    /dtk/coredump
  165. discard stream  tcp     nowait  root    /dtk/coredump
  166. discard dgram   udp     wait    root    /dtk/coredump
  167. daytime stream  tcp     nowait  root    /dtk/coredump
  168. daytime dgram   udp     wait    root    /dtk/coredump
  169. chargen stream  tcp     nowait  root    /dtk/coredump
  170. chargen dgram   udp     wait    root    /dtk/coredump
  171. time    stream  tcp     nowait  root    /dtk/coredump
  172. time    dgram   udp     wait    root    /dtk/coredump
  173. serv8   stream  tcp     nowait  root    /dtk/coredump
  174. serv10  stream  tcp     nowait  root    /dtk/coredump
  175. serv12  stream  tcp     nowait  root    /dtk/coredump
  176. serv14  stream  tcp     nowait  root    /dtk/coredump
  177. serv16  stream  tcp     nowait  root    /dtk/coredump
  178. domain  stream  tcp     nowait  root    /dtk/coredump
  179. ftp     stream  tcp     nowait  root    /dtk/coreump
  180. telnet  stream  tcp     nowait  root    /dtk/coreump
  181. timed   stream  tcp     nowait  root    /dtk/coreump
  182. route   stream  tcp     nowait  root    /dtk/coreump
  183. tempo   stream  tcp     nowait  root    /dtk/coreump
  184. mysql   stream  tcp     nowait  root    /dtk/coreump
  185. irc     stream  tcp     nowait  root    /dtk/coreump
  186. netbios-sn      stream  tcp     nowait  root    /dtk/coreump
  187.  
  188. Deception Tool Kit can be found here:
  189. http://www.all.net/dtk
  190.  
  191. 5. SSH
  192.  
  193. Secure shell should replace telnet running on a machine
  194. by all means. SSH simply encrypts data to and from hosts,
  195. which basically means anyone who's set up a sniffer on
  196. your machine is sniffing useless info. Beware of the
  197. latest program I've seen at Packet Storm Security which
  198. affects v 1.2.27 though. Supposedly it backdoors a magic
  199. password on that version to allow connection. For Windows
  200. users who connect to your box, recommend they download
  201. Secure CRT or some other client to continue accessing
  202. your machine.
  203.  
  204.  
  205. These are for the most part the minimal amount of tools
  206. I've used and am happy with. You can always check into
  207. PacketStorm.Securify.com and check the files their left
  208. and right.
  209.  
  210. I would definitely explain a lot more stuff but this
  211. is only makeshift remedy for possibly a workstation or
  212. 1-10 machine network.
  213.  
  214. SSH can be found here:
  215. ftp://ftp.cs.hut.fi/pub/ssh/
  216.  
  217. 6. SARA
  218.  
  219. SARA is the evolution of SATAN which is a kick ass Unix
  220. Auditing tool. This is definitely a must IMHO on any
  221. system you manage. While SATAN is pretty much outdated,
  222. SARA is updated constantly in tune with the newest
  223. remote vulnerabilities. Here some of the features of
  224. SARA... And best of all, like good security software
  225. its free.
  226.  
  227.  
  228. Built-in report writer (by subnet or by database)
  229. Built-in summary table generator
  230. FTP Bounce test
  231. Mail relay test
  232. Gateway to external programs (e.g., NMAP)
  233. CGI-BIN vulnerability testing (Unix and IIS)
  234. SSH buffer overflow vulnerabilities
  235. Current Sendmail vulnerabilities
  236. IMAPD/POPD buffer overflow vulnerabilities
  237. Current FTP and WU-FTP vulnerabilities
  238. Tooltalk buffer overflow vulnerbilities
  239. Netbus, Netbus-2, and Back Orifice vulnerabilities
  240. Improved Operating System fingerprinting
  241. Firewall-aware
  242. Weekly updates
  243. Probing for non-password accounts
  244. NFS file systems exported to arbitrary hosts
  245. NFS file systems exported to unprivileged programs
  246. NFS file systems exported via the portmapper
  247. NIS password file access from arbitrary hosts
  248. REXD access from arbitrary hosts
  249. X server access control disabled
  250. Arbitrary files accessible via TFTP
  251. Remote shell access from arbitrary hosts
  252. Writable anonymous FTP home directory
  253.  
  254. SARA can be downloaded via its homepage:
  255. http://home.arc.com/sara/index.html
  256.  
  257. 7. Check.pl
  258.  
  259. Check.pl 1.0 runs through all of the files and
  260. directories that it is given as arguments and
  261. determines the permissions. It then sends a list
  262. of "dangerous" files to stdout which can be
  263. redirected to a file. This program should be run
  264. as a regular user to check for writeable
  265. directories, suid, guid, and writeable files.
  266. Helps admins sniff out files that have incorrect
  267. permissions. Changes: Changes in reporting for
  268. first public release, runs slightly faster,
  269. added limits to depth of directory recursion so
  270. as to avoid the GNOME circular symlink problem
  271. in home directories.
  272.  
  273. (graciously ripped exlanantion taken from PSS..
  274. whats up Matt ;) )
  275.  
  276. http://opop.nols.com/proggie.html
  277.  
  278.  
  279. 8. Snort (thanx to MAx for this reminder ;) )
  280. Snort is a libpcap-based packet sniffer/logger
  281. which can be used as a lightweight network
  282. intrusion detection system. It features rules based
  283. logging and can perform content searching/matching
  284. in addition to being used to detect a variety of
  285. attacks and probes, such as buffer overflows, stealth
  286. port scans, CGI attacks, SMB probes, and much more.
  287. Snort has a real-time alerting capabilty, with alerts
  288. being sent to syslog, a seperate "alert" file, or
  289. as WinPopup messages via Samba's smbclient.
  290.  
  291. Snort is freely available at:
  292. http://www.clark.net/~roesch/snort-1.3.1.tar.gz
  293.  
  294. -=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
  295.  
  296. Other tool reference sites:
  297.  
  298. http://www.network-defense.com
  299. (Mr. Gula is elite as hell)
  300.  
  301. http://www.l0pht.com
  302. (Anti Sniffer Sniffer is cool)
  303.  
  304. http://www.securityfocus.com
  305. (Bugtraq)
  306.  
  307. http://www.securitysearch.com
  308. (Security Oriented Yahoo)
  309.  
  310. http://www.freshmet.net
  311. (believe it or not I found some security shit here)
  312.  
  313. http://www.iss.net
  314. (For those corporate types who wanna pay for shit)
  315.  
  316. http://www.nfr.net
  317. (Network Flight Recorder owns)
  318.  
  319. http://www.AntiOffline.com
  320. (because its my doc and I 0wned myself 100 times)
  321.  
  322. -=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
  323.  
  324. iii     Better
  325.  
  326.  
  327. Now your probably reading this shit and saying this guy is
  328. a moron. And quite frankly I could care less, but I got tired
  329. of people e-mailing me with some 0-day message on securing
  330. their box. There are tons of better documentation and I
  331. could've easily said do a find / -perm 4000 and chmod that
  332. shit then yadda yadda, but this would've been too long.
  333.  
  334. So here is a quick list of some of the sites with a bit more
  335. details in securing your machine.
  336.  
  337. ------------------------------------------------------------
  338.  
  339. Lance Spitzer's Armoring Linux is a pretty cool doc for
  340. most newer Admins/Newbie/Cluebie users. He's actually
  341. a kick ass guy on the Checkpoint side of things ;) as well.
  342.  
  343. http://www.enteract.com/~lspitz
  344.  
  345.  
  346. BroncBuster has an ok doc written in accordance to Slackware.
  347. Even though he didn't give me an opportunity to interview
  348. him for the BroncBuster vs. Michael Jackson event, I ain't
  349. mad at him.
  350.  
  351. http://www.attrition.org/hosted/bronc
  352.  
  353.  
  354. Vetesgirl is a good friend, and has some cool shit on her
  355. page in reference to Linux. She is also the author of
  356. VetesScan which is also a cool ass tool to have around
  357. /usr/local/bin
  358.  
  359. http://www.self-evident.com
  360.  
  361.  
  362. Packet Storm Security is one of the biggest security sites
  363. around. Started by Ken Williams which is also one of the
  364. coolest people in the world, Packet Storm is on top of
  365. security like JP is on top of Brad's anus. Definitely a
  366. place to go and read documentation on everything from a-z.
  367.  
  368. http://packetstorm.securify.com
  369.  
  370. SecurityFocus is another one of the coolest sites to gain
  371. info from. This is AlephOne's bugtraq site, complete with
  372. tools, documentation, postings, etc.
  373.  
  374. http://www.securityfocus.com
  375.  
  376.  
  377. SecuritySearch is a search engine dedicated to security and
  378. should be in your bookmark list. This is the most thorough
  379. search engine related to security I've found. Although you
  380. do have to watch those damn geoshitty sites that have sprung
  381. up there like the plague... ;)
  382.  
  383. http://www.securitysearch.net
  384.  
  385. XForce has some pretty cool documentation related to security.
  386. While I get tired of typing this 1/2 hour doc, I'll just throw
  387. in links and you can check em for yourself.
  388.  
  389. http://xforce.iss.net
  390.  
  391. NMRC (great Novell documentation)
  392. http://www.nmrc.org
  393.  
  394.  
  395. Rewted Labs
  396. (pestilence sector9 bell are cool as hell)
  397. http://www.rewted.org
  398.  
  399.  
  400. Technotronic Security
  401. http://www.technotronic.com
  402.  
  403. -=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
  404.  
  405. iv      AfterEffects
  406.  
  407. Yes I could've went on about Shadow, Tripwire, SKEY, or
  408. whatever else I wanted to but this was only meant to be
  409. a refreshing document to help joe/jane shmoe maintain a
  410. scriptkiddie free box. Besides hasn't this same file been
  411. written over and over?
  412.  
  413. I would definitely visit some of the links mentioned in the
  414. Better section to get a better overview on certain issues.
  415. I would definitely visit Lance Spitzer's site and reference
  416. his Armoring tutorial which is pretty detailed. Bronc's
  417. document is pretty good to although its a bit outdated since
  418. he wrote it using Slackware probably 2.0.34 or so.
  419.  
  420. So there you go... The Newbies guide to securing your 0-day
  421. in a nutshell without all the ugliness of technical talk:
  422.  
  423. @ARGV = ("/etc/master.passwd");
  424. $^I = "~/.h0h0";
  425. while (<>) {
  426.         s#:[^:]*$:/bin/sh
  427. print;
  428.  
  429. -=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
  430.  
  431. v       Copyrights
  432.  
  433. This document was written on the sole basis of wasting my
  434. time and yours. It is not intended for large networks nor
  435. should be used as a reference to the internal security
  436. of your PC as a 100% hack proof workstation. If you've
  437. managed to grep a shred of knowledge through this doc then
  438. it should be on your bearing to better secure your own
  439. damn PC without anyone elses help. Copyrights only apply
  440. to lawyers and loser who don't care to share what would
  441. normally be free information with the world, or are
  442. trying to protect an idea that has been thought of by
  443. someone too poor to pay for that idea. This document
  444. may be freely distributed as long as it is not mirrored
  445. until you've ping -f'd 127.0.0.1 yourself to oblivion.
  446.  
  447.  
  448. J. Oquendo
  449. sil@antioffline.com
  450.  
  451. efnet
  452. #unixgods       #syndrome       #bofh
  453.  
  454.  
  455.  
  456.